import { request } from '@/utils/request'

//根据手机号查询咨询师的信息
export const getconsultantInfoByaccount = (account) =>
  request('/consultant/getconsultantInfoByaccount', 'GET', { account })

//咨询师发布文章接口
export const addArticle = (formData) => request('/consultant/addArticle', 'POST', formData)

//咨询师删除文章接口
export const delArticle = (id) => request('/consultant/delArticle', 'POST', { id })

//根据文章id查询文章的内容
export const getArticleByid = (id) => request('/consultant/getArticleByid', 'GET', { id })

//根据文章id修改文章的信息接口
export const updateArticleByid = (formData) =>
  request('/consultant/updateArticleByid', 'POST', formData)

//根据咨询师的姓名查询发布的所有文章
export const getAllArticleByConsultant = (author) =>
  request('/consultant/getAllArticleByConsultant', 'GET', { author })

//咨询师修改个人名片的接口
export const updateConsultantInfo = (formData) =>
  request('/consultant/updateConsultantInfo', 'POST', formData)

//查询数据库中设定的预约时间段
export const gettimeperiods = () => request('/consultant/gettimeperiods', 'GET')

//根据选择的日期查询空闲表中存在的空闲时间段
export const getavailableTimeBydate = (id, date) =>
  request('/consultant/getavailableTimeBydate', 'GET', { id, date })

//咨询师添加空闲时间段接口
export const addAvailableTimeBycoun_id = (formData) =>
  request('/consultant/addAvailableTimeBycoun_id', 'POST', formData)

//咨询师获取用户预约记录信息
export const getAppointmentInfoBycoun_id = (coun_id) =>
  request('/consultant/getAppointmentInfoBycoun_id', 'GET', { coun_id })

//根据沪起始日期和结束日期搜素用户预约咨询记录
export const getappo_infoBystart_endTime = (coun_id, startTime, endTime) =>
  request('/consultant/getappo_infoBystart_endTime', 'GET', { coun_id, startTime, endTime })

//获取咨询师预约状态为scheduled并且时间在今天以后得信息接口
export const getScheduleConsultantDataAfter = (coun_id) =>
  request('/consultant/getScheduleConsultantDataAfter', 'GET', { coun_id })

//根据预约号id来查询对应用户信息
export const getUserInfoByAppointment_id = (appointment_id) =>
  request('/consultant/getUserInfoByAppointment_id', 'GET', { appointment_id })

//根据预约号id来查询对应的用户id
export const getconsultantIdByappointment_id = (appointment_id) =>
  request('/consultant/getconsultantIdByappointment_id', 'GET', { appointment_id })
